<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="java.util.*" import="cameraConfig.*" import="java.net.URI;"%>
<%@page language="java" contentType="text/html" pageEncoding="UTF-8"%>


 <jsp:useBean id="camDAO" class="cameraConfig.KameraDAO" scope="session"/>
 	<jsp:setProperty name="camDAO" property="*"/>
<jsp:useBean id="standort" scope="request" class="cameraConfig.Standort" type="cameraConfig.Standort" />	
 	
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Edit location: <% out.print( ( (Standort)request.getAttribute("locationToEdit") ).getName() );%></title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/Resources/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/Resources/Styles/back.css">
    <script src="${pageContext.request.contextPath}/Resources/Scripts/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/Resources/Scripts/script.js"></script>
    <script src="${pageContext.request.contextPath}/Resources/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
</head>


<%
	//Kameraobjekt aus Request holen
	standort = (Standort)request.getAttribute("locationToEdit");

%>
<body>
    <form action="LocationEditController" name="appform" method="post" id="target" class="form-horizontal">
        <div class="item-active">
            <div class="container">
                <div class="panel active">
                    <ul class="nav nav-tabs nav-pills" id="myTab">
                        <li class=""> <a href="cameras" data-toggle="tab">Cameras</a>
	                    <li class="active dropdown">
	                         <a class="dropdown-toggle" data-toggle="dropdown">Management<span class="caret"></span></a>
	                         <ul class="dropdown-menu" role="menu">
	                            <li><a class="addUser" href="#addUser" data-toggle="tab">Add New user</a></li>
	                            <li><a class="showUsers" href="#ShowUsers" data-toggle="tab">Show User List</a></li>
	                            <li><a class="addCamera" href="#AddCamera" data-toggle="tab">Add New Camera</a></li>
	                         </ul>
	                    </li>
                        <li class=""> <a href="#" data-toggle="tab">About</a>
                        <li class="pull-right"> <a class="logout" href="#" data-toggle="tab">Logout</a>
                    </ul>
                    <br>
                    <div class="tab-content">
                		<%-- <c:if test="${UserBean.isAdmin()}"> --%>
	                        <div class="row">
	                            <fieldset>
	                                <div class="form-group">
	                                    <label for="locName" class="col-lg-3 control-label">Location name:</label>
	                                    <div class="col-md-6">
	                                        <input type="text" required="" class="form-control input-md" placeholder="locName" name="locName" id="locName" value="<%out.print(standort.getName());%>">
	                                        <span class="help-block">Enter name of location here</span>
	                                    </div>
	                                </div>
	                                <div class="component" data-content="&lt;form role=&quot;form&quot;&gt;" data-title="Text Input" data-trigger="manual" data-html="true">
	                                    <!-- Text input-->
	                                    <div class="form-group">
	                                        <label for="locDescription" class="col-lg-3 control-label">Location description:</label>
	                                        <div class="col-md-6">
	                                            <input type="text" required="" class="form-control input-md" placeholder="locDescription" name="locDescription" id="locDescription" value="<%out.print(standort.getBeschreibung());%>">
	                                            <span class="help-block">Enter description of the location here</span>
	                                        </div>
	                                    </div>
	                                </div>
	                                <div class="component" data-content="&lt;form role=&quot;form&quot;&gt;" data-title="Button" data-trigger="manual" data-html="true">
	                                    <div class="form-group">
	                                        <div class="col-md-6">
	                                            <label for="brnOk" class="col-lg-3 control-label"></label>
	                                            <button name="btnAddCamera" value="OK" type="submit" class="btn btn-primary" style="width: 16em">Save this location</button>
	                                        </div>
	                                         <div class="col-md-6">
	                                            <label for="brnOk" class="col-lg-3 control-label"></label>
	                                            <button name="btnDeleteCamera" value="OK" type="submit" class="btn btn-primary" style="width: 16em">Delete this camera</button>
	                                    </div>
	                                    </div>
	                                </div>
	                            </fieldset>                    
	                        </div> 
                        <%-- </c:if>  --%>  
                    </div>
                </div>
            </div>
        </div>
    </form>
</body>
</html>
